package com.rock.code.common.util;

import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.SchedulerFactory;
import org.quartz.impl.StdSchedulerFactory;

/**
 * @author zhangli
 * @version V1.0
 * @create 2019-02-21 10:05
 **/
public class CollSchedulerFactory {

    private static SchedulerFactory sf = new StdSchedulerFactory();
    private static Scheduler scheduler = null ;

    public static synchronized Scheduler getScheduler(){
        if(scheduler==null)
        {
            try {
                scheduler = sf.getScheduler();
            } catch (SchedulerException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
        return scheduler;
    }

}